import { get, post, put, del, getWithArgs } from '../utils/xFetch2'
// import axios from 'axios'

const userAPI = {
    // 登录
    login: params => {
        return post('api/v1/users/login', params)
    },
    regist: params => {
        return post('api/v1/users/register', params)
    },
    getInfo: () => {
        return getWithArgs('api/v1/users/auth')
    },
    getCompUser: () => {
        return getWithArgs('api/v1/comp/users')
    },
    getUsers: (params) => {
        return getWithArgs('api/v1/users',params)
    },
    deleteUser: (id) => {
        return del(`api/v1/users/${id}`)
    },
    updateUser: (params) => {
        return put(`api/v1/users`, params)
    },
    updateUserPwd: (params) => {
        return put(`api/v1/users/updatePass`, params)
    },
}

export default userAPI
